package cn.iocoder.yudao.module.voice.cc.service.impl;

import cn.iocoder.yudao.module.voice.cc.service.StringEncryptorService;
import org.jasypt.encryption.StringEncryptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 加密解密
 * @author 徐利民
 * @date 2023/12/19 16:16
 */
@Service("stringEncryptorService")
public class StringEncryptorServiceImpl implements StringEncryptorService {

    @Autowired
    private StringEncryptor stringEncryptor;

    /**
     * 加密
     * @param: text
     * @return: java.lang.String
     * @author xulimin
     * @date: 2023/12/19 16:21
     */
    @Override
    public String encrypt(String text) {
        return stringEncryptor.encrypt(text);
    }


    /**
     * 解密
     * @param: text
     * @return: java.lang.String
     * @author xulimin
     * @date: 2023/12/19 16:21
     */
    @Override
    public String decrypt(String text) {
        return stringEncryptor.decrypt(text);
    }
}
